<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>


<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/login.css" />
<script src="scripts/jquery-1.6.2.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function() {
		if (typeof location.search) {
			var value = location.search;
			var statue = value.split('=')[1]; //得到登录状态
			var show = $('#show');
			if (statue == 1) { //该用户不存在
				show.html('该用户不存在!');
			} else if (statue == 2) {
				//密码错误
				show.html('密码错误!');
			}
		}
	});

	function sub() {
		var tag = $("#show");
		var username = $("#account");
		var password = $("#password");
		var flag = true;
		if (Trim(username.val()) == "" || username.val() == null) {
			tag.text("账号不能为空！！");
			flag = false;
		} else if (Trim(password.val()) == "" || password.val() == null) {
			tag.text("密码不能为空！！");
			flag = false;
		}
		if (flag) {
			$('#form').submit(); //提交表单
		}
		return flag;
	}

	///去掉字符串前尾的空格
	function Trim(str) {
		return str.replace(/(\s*)|(\s*$)/g, "");
	}

	function key(evt) {
		if (evt.keyCode == 13) {
			return sub();
		}
	}
</script>
</head>
<body>
	<div style="float: left;">
		<img src='Images/img_logo_b.jpg' alt="湖南文理学院综合信息发布系统" />
	</div>
	<div id="login_div">
		<img id="login_image" src="Images/login_image.gif" alt="君欲善其事,必先利其器" />
	</div>
	<div>
		<div id="f_s">
			<form action="CheckLogin" method="post" id="form">

				<span id="f_s_span">&nbsp;用户登录:</span> <span id="show"></span>
				&nbsp;&nbsp;账号：<input type="text" class="inp" size=20 name="account"
					id="account" class="inp" onkeypress='javascript:return key(event);' />
				<br /> <br /> &nbsp;&nbsp;密码：<input type="password" size=20
					name="password" id="password" class="inp"
					onkeypress='javascript:return key(event);' /><br /> <br /> <input
					type="text" value="javascript:this.value=new Date()"
					style="display: none;"> &nbsp;&nbsp; <img alt="用户登陆"
					src="Images/login.gif" onclick="javascript:return sub();"
					id="login" /> <img src="Images/register_image.gif" alt="用户注册"
					onclick="window.open('register.html', '用户注册', 'height=400, width=500, top=200,left=500, toolbar=no,menubar=no, scrollbars=no, resizable=no,location=no, status=no');return false;" id="register" />


			</form>
		</div>
	</div>
</body>
</html>